<?php

use yii\helpers\Url;
use yii\helpers\ArrayHelper;
$this->registerCssFile('/css/index2.css');
?>
<?php echo $this->render("//layouts/index_slider", ["sliderData" => $sliderData]); ?>
<div class="icon-group">
    <div class="carousel-list">
        <?php for ($i = 0; $i < count($sliderData); $i++): ?>
            <i class="<?php echo $i == 0 ? "selected" : null; ?>"></i> 
        <?php endfor; ?>
    </div>
    <div class="icon-text">
        <div class="block">
            <a href="<?php echo Url::toRoute(["task/work"]); ?>">
                <i></i>
                <span>体验好评</span>
            </a>
        </div>
        <div class="block">
            <a href="<?php echo Url::toRoute(["taobao/index"]); ?>">
                <i></i>
                <span>电商推广</span>
            </a>
        </div>
        <div class="block">
            <a href="<?php echo Url::toRoute(["question/index"]); ?>">
                <i></i>
                <span>问卷调研</span>
            </a>
        </div>
        <div class="block">
            <a href="<?php echo Url::toRoute(["active/index"]); ?>">
                <i></i>
                <span>活动捧场</span>
            </a>
        </div>
    </div>
</div>
<div class="mid-icon-group">
    <div class="left-block">
        <a href="<?php echo Url::toRoute(["signin/index"]); ?>">
            <div class="text">
                <span>签到抽奖</span>
                <p>每日签到来领赏</p>
            </div>
            <i></i>
        </a>
    </div>
    <div class="right-block">
        <a href="javascript:;">
            <div class="text">
                <span>微任务</span>
                <p>找对的人，做对的事</p>
            </div>
            <i></i>
        </a>
    </div>
</div>
<div class="mid-banner">
    <img src="../images/index-mid-banner.png" alt=""/>
</div>
<div class="mid-notice">
    <img src="../images/index-mid-notice.png" alt=""/>
    <span class="title">皓夜快讯</span>
    <div class="text">
        <p>用户名&nbsp;&nbsp;完成任务！</p>
        <i></i><span><?php echo Yii::$app->formatter->asDecimal(Yii::$app->user->identity->wallet->amount); ?></span>
    </div>
</div>

<div class="index-task">
    <div class="task-title">
        <img src="../images/index-task-title.png" alt=""/>
        <span>小夜精选</span>
    </div>
    <?php if ($tasklist): ?>
        <div class="task-list">
            <?php foreach ($tasklist as $item): ?>
                <div class="group">
                    <div class="left">
                        <i class="<?php echo frontendx\models\WB_Task::$task_type_class[$item['type']]; ?>"></i>
                    </div>
                    <div class="mid">
                        <span class="title"><?php echo $item['title']; ?></span>
                        <small><?php echo $item['note']; ?></small>
                        <p><i></i> <span><?php echo Yii::$app->formatter->asDecimal($item["brush_price"]); ?></span></p>
                    </div>
                    <div class="right">
                        <a href="<?php echo Url::toRoute(["task/taskdetail2","taskid"=>$item["id"]]);?>"><button class="orange">领取</button></a>
                        <span><?php echo Yii::$app->formatter->asInteger($item['taskcount'] ? $item['taskcount'] : 0); ?>人 已做过</span>
                    </div>
                </div>
            <?php endforeach; ?>
        </div>
    <?php endif; ?>
</div>